const http = require('http')

//创建服务实例对象
const server = http.createServer()

//为服务实例绑定request事件
server.on('request',(req,res)=>{
    console.log('我的服务被请求了');
})

//启动服务
server.listen(8080,()=>{
    console.log('server running at http://127.0.0.1:8080');
})